<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/default/easyui.css"/>">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/icon.css"/>">
<link rel="stylesheet" type="text/css" href="<c:url value="/css/themes/yzr_style.css"/>">

<script type="text/javascript" src="<c:url value="/js/jquery.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/jquery.easyui.min.js"/>"></script>
<script type="text/javascript" src="<c:url value="/js/easyui-lang-zh_CN.js"/>"></script>
<title>耗材库存</title>
</head>
<body>
<script type="text/javascript">
$(function(){
	// 刷新
	$("#hc-kucun-sx").linkbutton({onClick:function(){
		$("#lmb-hckucun-dg").datagrid({
    		url: 'tofindAllKncun', 
    		method: 'get'
    	});
	}});
	
	//根据条件搜索
	$('#hc-kucun-search').searchbox({
	    searcher:function(value,name){
	    	$("#lmb-hckucun-dg").datagrid({	    					
	    		url: name == 'cName' ? 'to_findAllkucunByCname' : 'tofindAllByckName',
	    		method: 'post', 
	    		queryParams: {	
	    			shuxing: value,
	    			page:1, 
			    	rows:10			    	
	    	}});
	    }	
	}); 
});

		
</script>
	<table id="lmb-hckucun-dg" class="easyui-datagrid" data-options="
			url:'tofindAllKncunByPage',
			fitColumns:true,fit:true,
			pagination: true,
			pageSize: 5,
			pageList: [5, 10, 15, 20],
			rownumbers: true,
			toolbar: '#lmb—hc-kucun-dh',
			border:false
			">
		<thead>
			<tr>
				<th data-options="field:'',checkbox:true"></th>
				<th data-options="field:'cstocCid',width:'14%'">耗材编号</th>
				<th data-options="field:'cstocCname',width:'14%'">耗材名称</th>
				<th data-options="field:'cstocBatchNum',width:'7%'">批号</th>
				<th data-options="field:'cstocNorms', width:'7%',">单位</th>
				<th data-options="field:'cstocNum',width:'7%'">数量</th>									
				<th data-options="field:'cstockProductDate', width:'10%',
						formatter:function(value){
						if(value){
							var date = new Date(value);  
                            return date.toLocaleDateString();
						}
                            
                 }">生产日期</th>
                 <th data-options="field:'cstockValidTill', width:'10%',
						formatter:function(value){
						if(value){
							var date = new Date(value);  
                            return date.toLocaleDateString();
						}
                            
                 }">有效日期</th>	
                 <th data-options="field:'ckName', width:'15%'">仓库名称</th>
			</tr>
		</thead>
	</table>
	<div id="lmb—hc-kucun-dh">
		<a id="hc-kucun-sx" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
		<input id="hc-kucun-search" class="easyui-searchbox" data-options="menu: '#lmb-hc-kncun-mm', width: 250, prompt: '请输入要查询的内容'"/>
	</div> 
	
	<!-- 搜索栏 -->
	<div id="lmb-hc-kncun-mm" style="width:120px">
	    <div data-options="name:'cName'">耗材名称</div>
	    <div data-options="name:'ckName'">仓库</div>
	</div>
	
</body>
</html>